package org.example.egweibo8.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
public class UserRegDTO {
    @ApiModelProperty(value = "昵称",dataType = "string",required = true)
    @NotBlank(message = "昵称不能为空")
    private String nickname;
    @NotBlank(message = "密码不能为空白")
    @Size(max = 6, message = "密码不能超过6位")
    @ApiModelProperty(value = "密码",dataType = "string",required = true)
    private String password;
    @NotBlank(message = "用户名不能为空")
    @Pattern(regexp = "//w+", message = "用户名只能为数字/英文名大小写/下划线")
    @Size(min = 2, max = 10, message = "用户名必须为2-8位")
    @ApiModelProperty(value = "用户名",dataType = "string",required = true)
    private String username;
}
